\(\int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx\) [362]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F(-1)]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 68 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {b x \sqrt {-c+d x} \sqrt {c+d x}}{2 d^2}+\frac {\left (b c^2+2 a d^2\right ) \text {arctanh}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{d^3} \]

[Out]

(2*a*d^2+b*c^2)*arctanh((d*x-c)^(1/2)/(d*x+c)^(1/2))/d^3+1/2*b*x*(d*x-c)^(1/2)*(d*x+c)^(1/2)/d^2

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {397, 65, 223, 212} \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {\left (2 a d^2+b c^2\right ) \text {arctanh}\left (\frac {\sqrt {d x-c}}{\sqrt {c+d x}}\right )}{d^3}+\frac {b x \sqrt {d x-c} \sqrt {c+d x}}{2 d^2} \]

[In]

Int[(a + b*x^2)/(Sqrt[-c + d*x]*Sqrt[c + d*x]),x]

[Out]

(b*x*Sqrt[-c + d*x]*Sqrt[c + d*x])/(2*d^2) + ((b*c^2 + 2*a*d^2)*ArcTanh[Sqrt[-c + d*x]/Sqrt[c + d*x]])/d^3

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 397

Int[((a1_) + (b1_.)*(x_)^(non2_.))^(p_.)*((a2_) + (b2_.)*(x_)^(non2_.))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symb
ol] :> Simp[d*x*(a1 + b1*x^(n/2))^(p + 1)*((a2 + b2*x^(n/2))^(p + 1)/(b1*b2*(n*(p + 1) + 1))), x] - Dist[(a1*a
2*d - b1*b2*c*(n*(p + 1) + 1))/(b1*b2*(n*(p + 1) + 1)), Int[(a1 + b1*x^(n/2))^p*(a2 + b2*x^(n/2))^p, x], x] /;
 FreeQ[{a1, b1, a2, b2, c, d, n, p}, x] && EqQ[non2, n/2] && EqQ[a2*b1 + a1*b2, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {b x \sqrt {-c+d x} \sqrt {c+d x}}{2 d^2}-\frac {\left (-b c^2-2 a d^2\right ) \int \frac {1}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx}{2 d^2} \\ & = \frac {b x \sqrt {-c+d x} \sqrt {c+d x}}{2 d^2}+\frac {\left (b c^2+2 a d^2\right ) \text {Subst}\left (\int \frac {1}{\sqrt {2 c+x^2}} \, dx,x,\sqrt {-c+d x}\right )}{d^3} \\ & = \frac {b x \sqrt {-c+d x} \sqrt {c+d x}}{2 d^2}+\frac {\left (b c^2+2 a d^2\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{d^3} \\ & = \frac {b x \sqrt {-c+d x} \sqrt {c+d x}}{2 d^2}+\frac {\left (b c^2+2 a d^2\right ) \tanh ^{-1}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{d^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.18 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.00 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {b d x \sqrt {-c+d x} \sqrt {c+d x}+2 \left (b c^2+2 a d^2\right ) \text {arctanh}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{2 d^3} \]

[In]

Integrate[(a + b*x^2)/(Sqrt[-c + d*x]*Sqrt[c + d*x]),x]

[Out]

(b*d*x*Sqrt[-c + d*x]*Sqrt[c + d*x] + 2*(b*c^2 + 2*a*d^2)*ArcTanh[Sqrt[-c + d*x]/Sqrt[c + d*x]])/(2*d^3)

Maple [A] (verified)

Time = 4.17 (sec) , antiderivative size = 111, normalized size of antiderivative = 1.63

method result size
risch \(-\frac {\left (-d x +c \right ) \sqrt {d x +c}\, b x}{2 d^{2} \sqrt {d x -c}}+\frac {\left (2 a \,d^{2}+b \,c^{2}\right ) \ln \left (\frac {x \,d^{2}}{\sqrt {d^{2}}}+\sqrt {d^{2} x^{2}-c^{2}}\right ) \sqrt {\left (d x -c \right ) \left (d x +c \right )}}{2 d^{2} \sqrt {d^{2}}\, \sqrt {d x -c}\, \sqrt {d x +c}}\) \(111\)
default \(\frac {\sqrt {d x -c}\, \sqrt {d x +c}\, \left (\operatorname {csgn}\left (d \right ) d \sqrt {d^{2} x^{2}-c^{2}}\, b x +\ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) b \,c^{2}+2 \ln \left (\left (\sqrt {d^{2} x^{2}-c^{2}}\, \operatorname {csgn}\left (d \right )+d x \right ) \operatorname {csgn}\left (d \right )\right ) a \,d^{2}\right ) \operatorname {csgn}\left (d \right )}{2 d^{3} \sqrt {d^{2} x^{2}-c^{2}}}\) \(124\)

[In]

int((b*x^2+a)/(d*x-c)^(1/2)/(d*x+c)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2*(-d*x+c)*(d*x+c)^(1/2)*b*x/d^2/(d*x-c)^(1/2)+1/2*(2*a*d^2+b*c^2)/d^2*ln(x*d^2/(d^2)^(1/2)+(d^2*x^2-c^2)^(
1/2))/(d^2)^(1/2)*((d*x-c)*(d*x+c))^(1/2)/(d*x-c)^(1/2)/(d*x+c)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.93 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {\sqrt {d x + c} \sqrt {d x - c} b d x - {\left (b c^{2} + 2 \, a d^{2}\right )} \log \left (-d x + \sqrt {d x + c} \sqrt {d x - c}\right )}{2 \, d^{3}} \]

[In]

integrate((b*x^2+a)/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

1/2*(sqrt(d*x + c)*sqrt(d*x - c)*b*d*x - (b*c^2 + 2*a*d^2)*log(-d*x + sqrt(d*x + c)*sqrt(d*x - c)))/d^3

Sympy [F(-1)]

Timed out. \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\text {Timed out} \]

[In]

integrate((b*x**2+a)/(d*x-c)**(1/2)/(d*x+c)**(1/2),x)

[Out]

Timed out

Maxima [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.31 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {b c^{2} \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{2 \, d^{3}} + \frac {a \log \left (2 \, d^{2} x + 2 \, \sqrt {d^{2} x^{2} - c^{2}} d\right )}{d} + \frac {\sqrt {d^{2} x^{2} - c^{2}} b x}{2 \, d^{2}} \]

[In]

integrate((b*x^2+a)/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

1/2*b*c^2*log(2*d^2*x + 2*sqrt(d^2*x^2 - c^2)*d)/d^3 + a*log(2*d^2*x + 2*sqrt(d^2*x^2 - c^2)*d)/d + 1/2*sqrt(d
^2*x^2 - c^2)*b*x/d^2

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.16 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {\sqrt {d x + c} \sqrt {d x - c} {\left (\frac {{\left (d x + c\right )} b}{d^{2}} - \frac {b c}{d^{2}}\right )} - \frac {2 \, {\left (b c^{2} + 2 \, a d^{2}\right )} \log \left ({\left | -\sqrt {d x + c} + \sqrt {d x - c} \right |}\right )}{d^{2}}}{2 \, d} \]

[In]

integrate((b*x^2+a)/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="giac")

[Out]

1/2*(sqrt(d*x + c)*sqrt(d*x - c)*((d*x + c)*b/d^2 - b*c/d^2) - 2*(b*c^2 + 2*a*d^2)*log(abs(-sqrt(d*x + c) + sq
rt(d*x - c)))/d^2)/d

Mupad [B] (verification not implemented)

Time = 15.57 (sec) , antiderivative size = 417, normalized size of antiderivative = 6.13 \[ \int \frac {a+b x^2}{\sqrt {-c+d x} \sqrt {c+d x}} \, dx=\frac {\frac {2\,b\,c^2\,\left (\sqrt {c+d\,x}-\sqrt {c}\right )}{\sqrt {-c}-\sqrt {d\,x-c}}+\frac {14\,b\,c^2\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^3}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^3}+\frac {14\,b\,c^2\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^5}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^5}+\frac {2\,b\,c^2\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^7}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^7}}{d^3-\frac {4\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^2}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^2}+\frac {6\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^4}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^4}-\frac {4\,d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^6}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^6}+\frac {d^3\,{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^8}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^8}}+\frac {4\,a\,\mathrm {atan}\left (\frac {d\,\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}{\sqrt {-d^2}\,\left (\sqrt {c+d\,x}-\sqrt {c}\right )}\right )}{\sqrt {-d^2}}-\frac {2\,b\,c^2\,\mathrm {atanh}\left (\frac {\sqrt {c+d\,x}-\sqrt {c}}{\sqrt {-c}-\sqrt {d\,x-c}}\right )}{d^3} \]

[In]

int((a + b*x^2)/((c + d*x)^(1/2)*(d*x - c)^(1/2)),x)

[Out]

((2*b*c^2*((c + d*x)^(1/2) - c^(1/2)))/((-c)^(1/2) - (d*x - c)^(1/2)) + (14*b*c^2*((c + d*x)^(1/2) - c^(1/2))^
3)/((-c)^(1/2) - (d*x - c)^(1/2))^3 + (14*b*c^2*((c + d*x)^(1/2) - c^(1/2))^5)/((-c)^(1/2) - (d*x - c)^(1/2))^
5 + (2*b*c^2*((c + d*x)^(1/2) - c^(1/2))^7)/((-c)^(1/2) - (d*x - c)^(1/2))^7)/(d^3 - (4*d^3*((c + d*x)^(1/2) -
 c^(1/2))^2)/((-c)^(1/2) - (d*x - c)^(1/2))^2 + (6*d^3*((c + d*x)^(1/2) - c^(1/2))^4)/((-c)^(1/2) - (d*x - c)^
(1/2))^4 - (4*d^3*((c + d*x)^(1/2) - c^(1/2))^6)/((-c)^(1/2) - (d*x - c)^(1/2))^6 + (d^3*((c + d*x)^(1/2) - c^
(1/2))^8)/((-c)^(1/2) - (d*x - c)^(1/2))^8) + (4*a*atan((d*((-c)^(1/2) - (d*x - c)^(1/2)))/((-d^2)^(1/2)*((c +
 d*x)^(1/2) - c^(1/2)))))/(-d^2)^(1/2) - (2*b*c^2*atanh(((c + d*x)^(1/2) - c^(1/2))/((-c)^(1/2) - (d*x - c)^(1
/2))))/d^3